class Solution {
	public:
		string convert(string s, int numRows) {
			s_length = getLength(s);
			s_line = getLine(s,numRows);
		}
	private:
		int s_length;
		int s_line;
		int getLength(string s);
		int getLine(string s, int numRows);
};

int Solution::getLength(string s){
	int count = 0;
	int i = 0;
	while(s[i] != '\0'){
		i++;
		count++;
	}
	return count;
}

int Solution::getLine(string s, int numRows){
	int length = s_length;
	int count = 0;
	while(length > 0){
		count++;
		length -= numRows;
		if(length > 0){
			count++;
			length -= (numRows-2);
		}
		else break;
	}
	return count;
}
